package org.pettyfox.pfpay.utils;

import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.util.Date;

public class DateFormat {
    private static DateTimeFormatter fmt;

    public static String format(Date date){
        if(null == date){
            return "";
        }
        if(null ==fmt){
            fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
        }
        return fmt.print(date.getTime());

    }
}
